<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        function* gen(arg) {
            console.log(arg)
            let c = yield 111;
            console.log(c)
            let C = yield 222;
            console.log(C)
            let a = yield 333;
            console.log(a)
        }
        let ier = gen('aaa');
        console.log(ier.next());
        console.log(ier.next('CCC'));
        console.log(ier.next('ccc'));
        console.log(ier.next('ddd'));
    </script>
</body>

</html>